# Image
FROM centos:latest

# Environment veriable
ENV WKHTMLTOX_VERSION=0.12.6-1



#Copy patchs
RUN mkdir -p /tmp/patchs

COPY fonts/*  /tmp/patchs
COPY conf/*.repo  /etc/yum.repos.d

RUN yum clean all \
    && yum makecache

# Install needes packages
RUN arch=$(uname -m) \
    && yum install -y xorg-x11-fonts-75dpi \
    && yum install xorg-x11-fonts-Type1 -y \
    && cd /tmp/patchs/ \
    && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.aarch64.rpm \
    && rpm -ivh wkhtmltox-0.12.6-1.centos7.aarch64.rpm \



RUN yum install -y libreoffice-headless \
    && yum install -y libreoffice-writer \


    # Install windows fonts
RUN yum install -y fontconfig mkfontscale \

RUN cd /usr/share/fonts \
    && tar -xf /tmp/Windows_fonts.tar.gz -C /usr/share/fonts \
    && mkfontscale \
    && mkfontdir \
    && fc-cache -fv \
    && source /etc/profile \
    && fc-list | wc -latest \
    && yum install -y ttf-dejave \
    && fc-list | wc -latest \

    # Delete tmp 
RUN cd /tmp/patchs \
    &&  rm -rf *









